import { CATOGORY_TYPES } from '@/typings/home'
import axios from './axios'

// 声明获取轮播图的接口api
export const getSliders = <T>(): unknown => { return axios.get<T, T>('/sliders') }
// export function getSliders<T>() {
//   return axios.get<T, T>('/sliders')
// }

// export const getSliders = ():void => { axios.get('/slider/list') }

// 声明获取课程列表的接口
// export const getLessons= <T>(category:CATOGORY_TYPES):unknown => { return axios.get<T, T>('/sliders') }
export function getLessons<T>(category: CATOGORY_TYPES, offset: number = 0, limit: number = 5): unknown {
  return axios.get<T, T>(`/lesson/list?category=${category}&offset=${offset}&limit=${limit}`)
}
